package com.bite.friend.controller.file;

import com.bite.common.core.controller.BaseController;
import com.bite.common.core.domain.R;
import com.bite.friend.service.user.IFileService;
import com.bite.common.file.domain.OSSResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
//因为配置了个超时时间，但是时间多长合适呢？ 提供两个接口，一个上传，一个存，上传返回一个标识再去传回给后端存
public class FileController extends BaseController {

    @Autowired
    private IFileService sysFileService;
    @PostMapping("upload")
    public R<OSSResult>upload(@RequestBody MultipartFile file){
        return R.ok(sysFileService.upload(file));
    }






}
